package com.soft.javase.day09.hashset.removeduplicate;

import java.util.HashSet;
import java.util.Set;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/4/29
 */
public class RemoveDuplicate {
    public static void main(String[] args) {

        Set<Person> set = new HashSet<>();

        Person[] persons = new Person[6];

        persons[0]=new Person("张三",23);
        persons[1]=new Person("李四",28);
        persons[2]=new Person("张三",23);
        persons[3]=new Person("王五",30);
        persons[4]=new Person("李四",28);
        persons[5]=new Person("小明",22);

        for (Person person : persons) {
            set.add(person);
        }

        System.out.println(set);

    }
}
